package com.wyg.mybatis.enums;

public enum SexEnum {
	MALE(0,"男性"),
	FEMALE(1,"女性");


	SexEnum(int type, String value) {
		this.type = type;
		this.value = value;
	}
	
	private int type;
	private String value;
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}

	public static SexEnum getSexEnum(int type){
		SexEnum[] values = SexEnum.values();
		for (SexEnum value: values){
			if (value.getType() == type){
				return value;
			}
		}

		return null;
	}
	
}
